package cc.rengu.redp.common.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Tree<T, P extends Tree<T, P>> {

    private String id;

    private String key;    //前端selectTree组件、Menu组件

    private String title;  //前端selectTree组件、Menu组件

    private String value;  //前端selectTree组件

    private String text;   //目前作用和title一样

    private String type;

    private Double order;

    private List<P> children; //前端selectTree组件、Menu组件、Table组件

    private String parentId;

    private boolean hasParent = false;

    private boolean hasChildren = false;

    private Date createTime;

    private Date modifyTime;

    public void initChildren() {
        this.children = new ArrayList<>();
    }

}
